import { http } from "@/utils/http";

// Avatar list request parameters
interface AvatarListRequest {
  adAccountId: number;
  size: number;
  page?: number;
  dataList?: number[]; // avatar id list
}

// Avatar item interface
interface AvatarItem {
  adAccountId: number;
  avatarId: number;
  avatarType: number;
  description: string;
  avatarUrl: string;
  usedCount: number;
  createTime: number;
}

// Avatar list response
interface AvatarListResponse {
  code: number;
  msg: string;
  data: {
    list: AvatarItem[];
    total: number;
  };
}

// API endpoint for getting avatar list
export const getAvatarList = (params: AvatarListRequest) => {
  return http.request<AvatarListResponse["data"]>(
    "get",
    "/api/v1/system/all/avatar",
    {
      params
    }
  );
};
